package com.mhc.suzuki.constant;

/**
 * 角色类型枚举类
 * Created by kanon on 2017/9/29.
 */
public enum RoleTypeEnum {
    //系统管理员
    ROLE_SYSADMIN("ROLE_SYSADMIN", "系统管理员"),
    ROLE_SALESMAN("ROLE_SALESMAN", "业务员"),
    ROLE_SPSALESMAN("ROLE_SPSALESMAN", "SP业务员"),
    ROLE_SALESMANAGER("ROLE_SALESMANAGER", "业务经理"),
    ROLE_AUDITOR("ROLE_AUDITOR", "审核员"),
    ROLE_AUDITORMANAGER("ROLE_AUDITORMANAGER", "审核经理"),
    ROLE_RISKLEADER("ROLE_RISKLEADER", "分管领导"),
    ROLE_COOPERATIVE("ROLE_COOPERATIVE", "内勤/协同发展部"),
    ROLE_FINANCE("ROLE_FINANCE", "财务部"),
    ROLE_RISKCONTROL("ROLE_RISKCONTROL", "风控小组"),
    ROLE_ASSETS("ROLE_ASSETS", "资产保全部"),
    ROLE_STAFFINFO("ROLE_STAFFINFO", "用户"),
    ROLE_STAGNATIONMAN("ROLE_STAGNATIONMAN", "银行驻点员"),
    ROLE_ASSETSOUTWORKER("ROLE_ASSETSOUTWORKER", "资产保全部/外勤");

    private String code;
    private String name;

    RoleTypeEnum(String code, String name){
        this.code = code;
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public static RoleTypeEnum getRoleTypeEnum(String code) {
        for(RoleTypeEnum roleTypeEnum : RoleTypeEnum.values()){
            if(roleTypeEnum.code.equals(code)){
                return roleTypeEnum;
            }
        }
        //没有对应的类型，默认用户角色
        return RoleTypeEnum.ROLE_STAFFINFO;
    }

}
